<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script>
      var ay = ['zhang3', 'li4', 'wang5']
      //尾部添加元素
      ay.push('zhao6')
      ay.push('zhao7', 'zhang8')
      console.log('尾部添加元素:' + ay)

      var str = 'zhang3;li4;wang5'
      //把字符串按照指定字符分割成数组
      var ay2 = str.split(';')
      console.log('字符串split方法转成数组:' + ay2)

      //把数组中元素按照指定字符拼接字符串
      var str2 = ay.join(';')
      console.log('数组join拼接成字符串:' + str2)
    </script>
  </head>
  <body></body>
</html>
